package com.qingchuan.strategy.context;

import com.qingchuan.enums.GraphTypeEnum;
import com.qingchuan.strategy.BasicGraphStrategy;
import com.qingchuan.utils.SpringUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author m17610881257@163.com
 * @version : GraphContextStrategy.java, v 0.1 2022-05-25 00:03 m17610881257@163.com Exp $$
 * @Description 基本图形策略上下文管理
 */
@Slf4j
@Component
public class GraphContextStrategy {

    public String draw(String graphBeanName) {
        BasicGraphStrategy basicGraphStrategy = SpringUtils.getBean(graphBeanName, BasicGraphStrategy.class);
        // 画布上绘制基本图形
        return "恭喜您绘制成功,您当前正在" + basicGraphStrategy.draw();
    }

}
